package com.fresher.service;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.fresher.dao.LogDao;
import com.fresher.model.Log;
@Service
public class LogService {
	
	@Autowired
	private LogDao logDao;
	//get list of logs
	public  List<Log> getListLogs() {
		List<Log> LogsList = null;
		LogsList = logDao.getLogs();
		return LogsList;
	}
	
	//add log
	public  void  addLog(String logDetail, String username){
		logDao.addLog(logDetail, username);
	}
	
	public String getCurrentDateTime() {
		return new SimpleDateFormat("yyy/MM/dd HH:mm:ss").format(Calendar.getInstance().getTime());
	}
}
